<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/webjars/layui/2.6.8/dist/layui.js"></script>
    <link href="/webjars/layui/2.6.8/dist/css/layui.css">
</head>
<body>
<div id="app" class="layui-container">
    <div class="layui-table">
        <table>
            <thead>
            <tr>
                <td>学生编号</td>
                <td>姓名</td>
                <td>性别</td>
                <td>爱好</td>
                <td>课程</td>
                <td>
                    操作
                    <a th:href="@{/stu/toAdd}">【增】</a>
                </td>
            </tr>
            </thead>
            <tbody>
            <tr th:each="e:${students}">
                <td th:text="${e.id}"></td>
                <td th:text="${e.name}"></td>
                <td th:text="${e.sex}"></td>
                <td th:text="${e.hobby}"></td>
                <td>
                <span th:each="c:${e.courses}" th:text="${c.name}+' '">

                </span>
                </td>
                <td>
                    <a th:href="@{/stu/toUpdate(sid=${e.id})}">【改】</a>
                    <a th:href="@{/stu/toDelete(sid=${e.id})}">【删】</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

</div>
</body>
</html>